﻿using System;
using System.Collections.Generic;
using System.Text;

namespace JT1078.Gateway.Metadata
{
    /// <summary>
    /// 音视频信息
    /// </summary>
    public struct JT1078AVInfo
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sim"></param>
        /// <param name="channelNo"></param>
        public JT1078AVInfo(string sim, int channelNo)
        {
            Sim = sim;
            ChannelNo = channelNo;
        }
        /// <summary>
        /// sim
        /// </summary>
        public string Sim { get; set; }
        /// <summary>
        /// 通道号
        /// </summary>
        public int ChannelNo { get; set; }
        /// <summary>
        /// key
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return $"{Sim}_{ChannelNo}";
        }
    }

    public class GovRequestDto: GovRequestInput
    {
        public GovRequestDto(GovRequestInput a, GovRequestTokenInput b)
        {
            ChannelNo = a.ChannelNo;
            Cph = a.Cph;
            Cpys = a.Cpys;
            AvType = a.AvType;
            TokenInfo = b;
        }

        public GovRequestTokenInput TokenInfo { get; set; }
 
        public string SimNo { get; set; }
    }

    /// <summary>
    /// 政府视频监管平台请求信息
    /// </summary>
    public class GovRequestInput
    {
        public string Cpys { get; set; }

        public string Cph { get; set; }
        /// <summary>
        /// 通道号 1 2 3 4
        /// </summary>
        public string ChannelNo { get; set; }

        /// <summary>
        /// 音视频标志 0-音视频 1-音频 2-视频
        /// </summary>
        public string AvType { get; set; }
        /// <summary>
        /// 时效口令
        /// </summary>
        public string Token {  get; set; }  

        /// <summary>
        /// 获取部标实时播放时的数据类型  
        /// </summary>
        /// <returns></returns>
        public byte GetJt1078LiveDataType()
        {
            if (AvType == "0")
                return 0; 
            if (AvType == "1") 
                return 3;
            return 1;
        }
    }

    /// <summary>
    /// 政府视频监管平台请求信息-时效口令
    /// </summary>
    public class GovRequestTokenInput
    {
        /// <summary>
        /// 
        /// </summary>
        public string Timestamp { get; set; }
        /// <summary>
        /// 上级平台标志 绵阳运管固定为 MYYG
        /// </summary>
        public string GovTag { get; set; }
        /// <summary>
        /// 1-实时播放  2-播放历史视频 4-查询历史视频  5-下载视频
        /// </summary>
        public string ApiType { get; set; }
        /// <summary>
        /// 开始时间 yyyy-MM-dd HH:mm:ss
        /// </summary>
        public string STime { get; set; }
        /// <summary>
        /// 结束时间 yyyy-MM-dd HH:mm:ss
        /// </summary>
        public string ETime { get; set; }
 
    }
}
